
clear 
clc
cd 'C:\_bcoe\data_eyelink2'
folders = dir;
fred=[]
for i=1:length(folders)
    fred(i)=isdir(folders(i).name) & length(folders(i).name)>2; 
end
folders(~fred)=[];
clear fred;
folders.name
    
index=1;subject=[];

for i=[23 18]%length(folders)
   save folders    
   cd(folders(i).name);
    stage=2; % switch stages of analysis
    switch stage
        case 1
            eyelink2_blink_remover_sept2004;
            eyelink2_saccade_detector_apr05;
            %        case 2
            eyelink2_quad_plot04
        case 3
            % create amrs for all subjects
            % create vmrs fro all subjects (not necessary now but do it anyway!)
        case 4
            %renaming_fmrs
        case 5            
            % 3D motion correction and linear trend removal
        case 6
            %london_protocal_maker
        case 7
            %london_protocal_maker02
    end
    cd ..
    load folders   
    

end
bcoe
disp(' FIN! ')
